package com.heima.freemarker.controller;

/**
 * @ClassName HelloController
 * @Description TODO
 * @Author @O_o
 * @Date 2023/8/23 17:52
 * @Version 1.0
 */
import com.heima.pojo.Student;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Date;

/**
 * @Description:
 * @Version: V1.0
 */
@Controller  // ***
public class HelloController {


    @GetMapping("/basic")
    public String basic(Model model) {

        // String数据
        model.addAttribute("name", "黑马程序员");

        //对象数据
        Student student = new Student();
        student.setAge(20);
        student.setBirthday(new Date());
        student.setMoney(9000F);
        student.setName("小明");
        model.addAttribute("stu", student);

        // 找到页面
        return "01-basic";

    }
}
